var statisticalData={
    init:function(){
        var self=this;
        self.shadeDiv = $("#shade-div");
        self.bindEvents();

    },
    bindEvents:function(){
        var self=this;
        self.ajaxPOST("../../json/data.json",self.chartData);
        self.ajaxPOST("../../json/data.json",self.chartData1)
    },
    //    按日期查询
    chartData:function(data){
        $.statistic("container7",data.data_X1,data.data_Y1,data.title_X1);
    },
//    按年月查询
    chartData1:function(data){
        $.statistic("container8",data.data_X2,data.data_Y2,data.title_X2);
    },
    ajaxGET:function (url, fn,data,beforeSendFn) {
        var beforeSendFn = beforeSendFn || function(){};
        $.ajax({type:"GET", dataType:'json', context:this, url:url, data:data, success:fn, beforeSend:beforeSendFn});
    },
    ajaxPOST:function (url, fn,data,beforeSendFn) {
        var beforeSendFn = beforeSendFn || function(){};
        $.ajax({type:"POST", dataType:'json', context:this, url:url, data:data, success:fn, beforeSend:beforeSendFn});
    }
}
$(function(){
    statisticalData.init()
})